import 'package:division/division.dart';
import 'package:flutter/material.dart';
import 'package:s_mankey/config/resource_mananger.dart';
import 'package:s_mankey/config/router_config.dart';
import 'package:s_mankey/generated/I18n.dart';

class MyPage extends StatefulWidget {
  @override
  _MyPage createState() => _MyPage();
}

class _MyPage extends State<MyPage> {

  @override
  Widget build(BuildContext context) {

    List<String> title = [I18n.current.certification, I18n.current.setting];
//List<Widget>
    List<Icon> iconItems = [
      Icon(
        Icons.search,
        color: Colors.amber,
      ),
      Icon(
        Icons.settings,
        color: Colors.deepOrange,
      )
    ];

    return Scaffold(
      backgroundColor: Colors.grey[200],
      body: Column(
        children: <Widget>[
          Container(
            child: Image.network(
              AppImageUrl.AppBannerUrl,
              fit: BoxFit.fill,
            ),
          ),
          Container(
            margin: EdgeInsets.only(top: 10),
            decoration: BoxDecoration(
                color: Colors.white,
                border: Border(bottom: BorderSide(color: Colors.grey[300]))),
            child: MediaQuery.removePadding(
              removeTop: true,
              context: context,
              child: ListView.separated(
                shrinkWrap: true,
                physics: NeverScrollableScrollPhysics(),
                itemCount: iconItems.length,
                itemBuilder: (BuildContext context, int index) {
                  return ListTile(leading: iconItems[index],
                    title: Text(title[index]),
                    trailing: Icon(Icons.arrow_forward_ios,),
                    onTap: (){
                      Navigator.of(context).pushNamed(RouterName.moreSetting);
                    },
                  );
                },
                separatorBuilder: (BuildContext context, int index) {
                  return Divider(
                    color: Colors.grey,
                  );
                },
              ),
            ),
          ),
          Expanded(
            child: Container(
              color: Colors.white,
            ),
          ),
        ],
      ),
    );
  }
}



